package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.woniuxy.pojo.Member;

public interface MemberMapper {
	
	@Select("select * from member where mname like #{message} or mnumber like #{message} or midcard like #{message} or mtel like #{message} or mtype like #{message}")
	public List<Member> find(String message);

	@Select("select * from member")
	public List<Member> getAll();

	@Update("update member set mname=#{mname},mtel=#{mtel},mtype=#{mtype} where mnumber=#{mnumber}")
	public int updateMember(Member member);

	@Insert("insert into member values(default,#{mnumber},#{mname},#{mtel},#{midcard},#{mtype})")
	public int addMember(Member member);

	@Delete("delete from member where mnumber=#{mnumber}")
	public int delMember(String mnumber);

	@Select("select * from member where mname=#{name}")
	public List<Member> findByName(String name);

	@Select("selecte * from member where mname=#{mname} and midcard = #{midcard}")
	public Member findByMember(Member member);

	@Select("select * from member where mnumber=#{mnumber}")
	public Member findByMnumber(String mnumber);
}
